package demo3;

/**
 * @description:获取运行时类内部的丰富结构
 * @author:Mr.Cat
 * @create:2021-11-23 13:47
 **/
@MyAnnotation(value = "nihao")
public class Person extends Creature<String> implements Comparable<String>,MyInterface{

    private String name;
    int age;
    public int id;

    public Person(){

    }
    @MyAnnotation(value = "hi")
    private Person(String name){
        this.name=name;
    }
    Person (String name,int age){
        this.name=name;
        this.age=age;
    }
    @MyAnnotation
    private String  show(String nation){
        System.out.println("我是一个" + nation + "人");
        return nation;
    }

    public String display(String interests,int age)throws NullPointerException,ClassCastException{
        return interests+age;
    }

    @Override
    public void info() {
        System.out.println("我是李雄");
    }

    @Override
    public int compareTo(String o) {
        return 0;
    }
    public static void showDesc(){
        System.out.println("我是一个男人");
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", id=" + id +
                '}';
    }
}

